package common.Tables;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

/**
 * class Availability.
 * represents the Availability table
 * @author michal
 *
 */
public class Availability implements Serializable,Table {	
	private static final long serialVersionUID = 1L;
	private long avlID;	//serial number
	private String dateID;	//date from
	private String notes;	//notes
	private Set<Psychologists> psychs= new HashSet<Psychologists>(0); //set of psychs
	private Set<Diagnostics> diags= new HashSet<Diagnostics>(0);	//set of diagnostics
	String dateTo;	//date to (until when)
	int everyXtime;	//every X time period
	String time;	//week / day / month
	String day;	//day name	
	
	/*
	 * getters & setters
	 */
	public Set<Diagnostics> getDiags() {
		return diags;
	}
	public void setDiags(Set<Diagnostics> diags) {
		this.diags = diags;
	}
	public String getDay() {
		return day;
	}
	public void setDay(String day) {
		this.day = day;
	}
	public String getDateTo() {
		return dateTo;
	}
	public void setDateTo(String dateTo) {
		this.dateTo = dateTo;
	}
	public int getEveryXtime() {
		return everyXtime;
	}
	public void setEveryXtime(int everyXtime) {
		this.everyXtime = everyXtime;
	}
	public String getTime() {
		return time;
	}
	public void setTime(String time) {
		this.time = time;
	}	
	public long getAvlID() {
		return avlID;
	}
	public void setAvlID(long avlID) {
		this.avlID = avlID;
	}
	public String getNotes() {
		return notes;
	}
	public void setNotes(String notes) {
		this.notes = notes;
	}
	public Set<Psychologists> getPsychs() {
		return psychs;
	}
	public void setPsychs(Set<Psychologists> psychs) {
		this.psychs = psychs;
	}
	public Availability(String dateID) {

		this.dateID = dateID;
	}
	public Availability() {

	}
	public String getDateID() {
		return dateID;
	}

	public void setDateID(String dateID) {
		this.dateID = dateID;
	}
	/**
	 * method gets a diagnostic and adds him to the diags set
	 * @param diagnostics
	 */
	public void addDiagToDiagsSet(Diagnostics diagnostics) {
		// TODO Auto-generated method stub
		diags.add(diagnostics);
	}
	/**
	 * method gets a psychologist and removes it from the psychs set
	 * @param psych
	 */
	public void removePsychFromPsychsSet(Psychologists psych){
		psychs.remove(psych);
	}
	/**
	 * method gets a psych and adds it to the psychs set.
	 * @param psych
	 */
	public void addPsychToPsychsSet(Psychologists psych){
		psychs.add(psych);
	}
}
